<?php
/**
 * 카테고리 관련 model
 * 
 * @author gudals
 * @since 2013-08-14
 */

class modelContCateInfo extends modelContBase
{
    /**
     * 등록
     * 
     * @param string $sCateName 카테고리 명
     */
    public function insert($sCateName)
    {
        if (chkTypesVariable(array('string' => $sCateName)) === false) {
            return false;
        }
        
        $sQuery = "
            insert into bf_cate (
                cate_name
            ) values (
                '".$sCateName."'
            )
        ";
        
        return $this->executeQuery($sQuery, 'exec');
    }
    
    public function getList($sUse = '')
    {
        $sWhere = '';
        if (empty($sUse) === false) {
            $sWhere = "where cate_status = '".$sUse."'";
        }
        
        $sQuery = "
            select
                cate_num,
                cate_name,
                cate_status
            from
                bf_cate
            ".$sWhere."
        ";
        
        return $this->executeQuery($sQuery, 'rows');
    }
}